﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiExtCalc : OdGiBaseVectorizer, OdGiConveyorContext, OdGiDeviation
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiExtCalc(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiExtCalc_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiExtCalc obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiExtCalc()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiExtCalc(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		HandleRef OdGiConveyorContext.GetCPtr()
		{
			return new HandleRef(this, GlobalsPINVOKE.OdGiExtCalc_OdGiConveyorContext_GetCPtr(this.swigCPtr.Handle));
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		HandleRef OdGiDeviation.GetCPtr()
		{
			return new HandleRef(this, GlobalsPINVOKE.OdGiExtCalc_OdGiDeviation_GetCPtr(this.swigCPtr.Handle));
		}

		public new virtual OdGiRegenType regenType()
		{
			OdGiRegenType result = (OdGiRegenType)GlobalsPINVOKE.OdGiExtCalc_regenType(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual bool regenAbort()
		{
			bool result = GlobalsPINVOKE.OdGiExtCalc_regenAbort(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void draw(OdGiDrawable pDrawable)
		{
			GlobalsPINVOKE.OdGiExtCalc_draw(this.swigCPtr, OdGiDrawable.getCPtr(pDrawable));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void setExtents(OdGePoint3d newExtents)
		{
			GlobalsPINVOKE.OdGiExtCalc_setExtents(this.swigCPtr, OdGePoint3d.getCPtr(newExtents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void resetExtents()
		{
			GlobalsPINVOKE.OdGiExtCalc_resetExtents(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getExtents(OdGeExtents3d extents)
		{
			GlobalsPINVOKE.OdGiExtCalc_getExtents(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void setContext(OdGiContext pUserContext)
		{
			GlobalsPINVOKE.OdGiExtCalc_setContext(this.swigCPtr, OdGiContext.getCPtr(pUserContext));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdGiSubEntityTraitsData effectiveTraits()
		{
			OdGiSubEntityTraitsData result = new OdGiSubEntityTraitsData(GlobalsPINVOKE.OdGiExtCalc_effectiveTraits(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void affectTraits(OdGiSubEntityTraitsData pSource, OdGiSubEntityTraitsData destination)
		{
			GlobalsPINVOKE.OdGiExtCalc_affectTraits(this.swigCPtr, OdGiSubEntityTraitsData.getCPtr(pSource), OdGiSubEntityTraitsData.getCPtr(destination));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual bool effectivelyVisible()
		{
			bool result = GlobalsPINVOKE.OdGiExtCalc_effectivelyVisible(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void onTextProcessing(OdGePoint3d arg0, OdGeVector3d arg1, OdGeVector3d arg2)
		{
			GlobalsPINVOKE.OdGiExtCalc_onTextProcessing(this.swigCPtr, OdGePoint3d.getCPtr(arg0), OdGeVector3d.getCPtr(arg1), OdGeVector3d.getCPtr(arg2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual uint drawContextFlags()
		{
			uint result = GlobalsPINVOKE.OdGiExtCalc_drawContextFlags(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
